package snail.model;

import java.io.Serializable;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author Anna Anka
 */
public class Article implements Serializable {
    private int articleId;
    private int creatorUserId;
    private int categoryId;
    private String title;
    private String description;
    private int startPrice;
    private int buyNowPrice;
    private Date createDate;
    private Date expireDate;
    private User creatorUser;
    private Category category;
    private Set<Bid> bids = new HashSet<Bid>();
    private Set<User> watchingUsers = new HashSet<User>();

    public Set<User> getWatchingUsers() {
        return watchingUsers;
    }

    public void setWatchingUsers(Set<User> watchingUsers) {
        this.watchingUsers = watchingUsers;
    }

    public Bid getHighestBid() {
        if(bids.isEmpty())
            return null;
        else
            return Collections.max(bids);
    }

    public void setHighestBid(Bid highestBid) {
        // gör inget
    }

    public Set<Bid> getBids() {
        return bids;
    }

    public void setBids(Set bids) {
        this.bids = bids;
    }

    public int getArticleId() {
        return articleId;
    }

    public void setArticleId(int articleId) {
        this.articleId = articleId;
    }

    public int getBuyNowPrice() {
        return buyNowPrice;
    }

    public void setBuyNowPrice(int buyNowPrice) {
        this.buyNowPrice = buyNowPrice;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public int getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public User getCreatorUser() {
        return creatorUser;
    }

    public void setCreatorUser(User creatorUser) {
        this.creatorUser = creatorUser;
    }

    public int getCreatorUserId() {
        return creatorUserId;
    }

    public void setCreatorUserId(int creatorUserId) {
        this.creatorUserId = creatorUserId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getExpireDate() {
        return expireDate;
    }

    public void setExpireDate(Date expireDate) {
        this.expireDate = expireDate;
    }

    public int getStartPrice() {
        return startPrice;
    }

    public void setStartPrice(int startPrice) {
        this.startPrice = startPrice;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

}
